//
//  NetWorkTool.h
//  项目唯一
//
//  Created by 谌桃 on 16/7/6.
//  Copyright © 2016年 ryan.chen. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>

//成功回调
typedef void(^SuccessCompletedBlock)(id responseObject);
//失败回调
typedef void(^FailureCompletedBlock)(NSError * error);

@interface NetWorkTool : AFHTTPSessionManager

//网络请求单例
+ (instancetype)sharedManager;

//网络检测
+ (BOOL)isReachableByAFN;

//GET request
- (void)GETRequestWithUrlString:(NSString *)urlString
                         params:(NSDictionary *)params
                   successBlock:(SuccessCompletedBlock)success
                  failtureBlock:(FailureCompletedBlock)failture;


//POST request
- (void)POSTRequestWithUrlString:(NSString *)urlString
                          params:(NSDictionary *)params
                    successBlock:(SuccessCompletedBlock)success
                   failtureBlock:(FailureCompletedBlock)failture;


@end
